# /usr/bin/env python

# print('Hello World!\n Hello')
# print('Hello # world')
# print('I will now count my chickens:')
# print('Hens',25+30/6)
# print('Roosters',100-25*3%4)
# print('Now i will count the eggs:')
# print(3+2+1-5+4%2-1/4+6)
# print('Is it true that 3+2<5-7?')
# print('What is 3+2?',3+2)
# print('What is 5-7?',5-7)
# print("Oh,that's why it's False.")
# print('It is greater?',5>-2)

# care = 100
# space_in_a_Care = 4.0
# drivers = 30
# passengers = 90
# cars_not_driven = care - drivers
# care_driven = drivers
# carpool_capactity = care_driven * space_in_a_Care
# average_passengers_per_Car = passengers / care_driven
#
# print('There are', care, 'care available')
# print('There are noly', drivers, 'drivers available')
# print('There will be', cars_not_driven)
# print('We can trsnsport', carpool_capactity)
# print('We have', passengers)
# print('We need to put about',average_passengers_per_Car)


# my_name = 'wangzh'
# my_age=30
# my_height=40
# my_weight=155
# my_eyes='black'
# my_teeth='white'
# my_hair='black'
#
# print("Let's %s  talk about %s" % (my_name,my_name))
# #print("Let's talk about", '%s')
# print("He's %d inches talk" % my_height)
# print("He's %d pounds heavy" % my_weight)
# print("Actually that's not too heavy")
# print("He's got %s eyes and %s hair" %(my_age,my_hair))
# print("His teeth are usually %s depending on the coffee" %my_teeth)
# print("If i add %d,%d,and %d i get %d" %(my_age,my_height,my_weight,my_age+my_height+my_weight))

# pound = 2.54
# lb = 0.4535924
# print('Convert the pound %r into centimeters' % pound)
# print('Convert round%r inch to a kilogram' % lb)


# x = 'There are %d types of people' %10
# binary = 'binary'
# do_not = "don't"
# y = 'Thoset who know %s and those who %s' %(binary,do_not)
#
# print(x)
# print(y)
#
# print('I said: %r' %x)
# print("I also said: '%s" %y)
#
# hilarious = False
# joke_evaluation = "Isn't that joke so funny?! %r"
# print(joke_evaluation %hilarious)
#
# w = "This is the left side of ..."
# e = "a string with a right side ..."
#
# print(w+e)
# print("joke_evaluation % hilarious")


# print("Mary had a little lamb")
# print("Its fleece was white as %s" % 'snow')
# print("And everywhere that mary went")
# print("." *10)
# end1 = "C"
# end2 = "h"
# end3 = "e"
# end4 = "e"
# end5 = "s"
# end6 = "e"
# end7 = "B"
# end8 = "u"
# end9 = "r"
# end10 = "g"
# end11 = "e"
# end12 = "r"
# print(end1+end2+end3+end4+end5+end6,end=' ')
# print(end7+end8+end9+end10+end11+end12)
#
# print(end1+end2+end3+end4+end5+end6,end7+end8+end9+end10+end11+end12,sep=" ")


# formatter = "%r %r %r %r"
# print(formatter %(1,2,3,4))
# print(formatter %('one','two','three','four'))
# print(formatter %(True,False,False,True))
# print(formatter %(formatter,formatter,formatter,formatter))

#
# tobby_cat = "\tI'm tabbed in "
# persian_cat = "I'm split\non a line "
# backslash_cat = "I'm \\a \\a cat"
# fat_cat = '''
# I'll do a list:
# \t* cat food
# \t* Fishies
# \t* Ctnipe\n\t* Grass
# '''
#
# print(tobby_cat)
# print(persian_cat)
# print(backslash_cat)
# print(fat_cat)
#
# a = 'wangzh'
# b = '\\\\'
# print("Hello!\\abc\\n %s I lean %s" % (a, b))

# print("How old are you"),
# age = input()
# print("How tall are you"),
# height = input()
# print("How much do you weight"),
# weight = input()
# print("So,you're %r old,%r tall and %r heavy" % (age, height, weight))

# 习题12
# age = input("How old are you")
# height = input("how tall are you")
# weight = input("How much do you weight")
# print("So,you're %s old,%r tall and %r heavy" %(age,height,weight))



# 习题13

# from sys import argv
# script,frist,second,third = argv
#
# print("The script is called:",script)
# print("The first is called:",frist)
# print("The second is called:",second)
# print("The third is called:",third)



# 习题14

# from sys import  argv
# script,user_name = argv
#
# prompt = '>'
#
# print("Hi %s,I'm the %s script" %(user_name,script))
# print("I'd like to ask you a few question")
# print("Do you like me %s?" % user_name)
# likes = input(prompt)
#
# print("Where do you live %s?" % user_name)
# lives = input(prompt)
#
# print("What would you like to eat %s" % user_name)
# eat = input(prompt)
#
# print("What kind of computer do you have?")
# computer = input(prompt)
#
# print("""
# Alright,so you said %r about liking me.
# You live in %r.
# You like eat %r.
# And you hava a %r computer nice
# """ %(likes,lives,eat,computer))


# 习题15
# from sys import argv
# script,filename = argv
# txt = open(filename)
# print("Here's your file %r:" % filename)
# print(txt.read())
# print("Type the filename again:")
# file_again = input(">>")
# txt_again = open(file_again)
# print(txt_again.read())

# import os
# "r" r   读文件
# "w"
# with open("day1.txt","r") as f:
#     txt = f.read()
#
# with open("day2.txt","w") as f2:
#     f2.write(txt)

# 习题16
# with open("day1.txt","r") as d1:
#     day1 = d1.read()
# with open("day2.txt","w") as d2:
#     d2.write('from:'+ day1+'\n')
#     d2.write('\n')
#     d2.write('to: day2'+'\n')
#     d2.write('\n')
#     d2.write('c:'+day1+'\n')
#     d2.write('\t'+'2017')


# 习题18
# def 定义函数
# 函数格式：def 函数名() :
# def print_two(*args):
#     arg1, arg2 = args #解包
#     print("arg1:%r,arg2:%r" % (arg1, arg2))
#
# def print_two_again(arg1,arg2):
#     print("arg1:%r,arg2:%r" %(arg1,arg2))
#
# def print_one(arg1):
#     print("arg1: %r" % arg1)
#
# def print_none():
#     print("I got nothin")
#
# print_two("print1","print2")
# print_two_again("print3","print4")
# print_one("print5")
# print_none()

# 习题19


# def cheese_and_carakers(cheese_count,boxes_of_carchers):
#     print("You have %d cheese" % cheese_count)
#     print("You hava %d boxes of carchers " % boxes_of_carchers)
#
# print("We can just give the function number directly:")
# cheese_and_carakers(20,30)
# print("Or,we can use use variables from our script:")
# amount_of_Cheese = 10
# amount_of_carchers = 50
#
# cheese_and_carakers(amount_of_Cheese,amount_of_carchers)
#
# print("We can even do math inside too:")
# cheese_and_carakers(10+20,5+6)
# print("And we can combine the two,variables and math:")
# cheese_and_carakers(amount_of_Cheese+100,amount_of_carchers+1000)


# 习题20

# from sys import argv
#
# script, input_file = argv
#
#
# def print_all(f):
#     print(f.read())
#
#
# def rewind(f):
#     f.seek(0)
#
#
# def print_a_line(line_count, f):
#     print(line_count,f.readline())
#
#
# current_file = open(input_file)
# print("First lest;s print the whole file:\n")
# print_all(current_file)
# print("Now let's rewind,kind of like a tape")
# rewind(current_file)
# print("Let's print three lines:")
# current_line = 1
# print_a_line(current_line, current_file)
#
# current_line = current_line + 1
# print_a_line(current\line, current_file)
#
# current_line = current_line + 1
# print_a_line(current_line, current_file)



# 习题21

# def add(a, b):
#     print("ADDING %d + %d" % (a, b))
#     return a + b
#
#
# def subract(a, b):
#     print("SUBTRACTING %d - %d" % (a, b))
#     return a - b
#
#
# def multiply(a, b):
#     print("multiply %d * %d" % (a, b))
#     return a * b
#
#
# def divide(a, b):
#     print("DIVDING %d /%d" % (a, b))
#     return a / b
#
#
# print("Lest's do some math wiht just fuctions")
#
# age = add(30, 5)
# height = subract(78, 4)
# weight = multiply(90, 2)
# iq = divide(100, 2)
#
# print("age:%d,height:%d,weight:%d,iq:%d" % (age, height, weight, iq))
# what = add(age, subract(height, multiply(weight, divide(iq, 2))))
# print("That becomes:", what, 'Can you do it by hand')
#


# 习题24

# print("Let's oractiec everything")
# print("You\'d need to know \'bout escapes wuth \\ that do \n newlines and \t rabs")
#
# poem ="""
# \tThe lovely world
# with logic so firmly planted
# cannot discern \n the needs of love
# nor conperethed passion from intuition
# and requies an explanation
# \n\t\twhere there is none
# """
#
# print("---------------")
# print(poem)
# print("---------------")
#
# five = 10 -2 +3 -6
# print("This should be five: %s" % five)
#
# def secret_formula(started):
#     jelly_beans = started*500
#     jars = jelly_beans/1000
#     crates = jars/100
#     return  jelly_beans,jars,crates
#
# start_point = 1000
# beans,jars,crates  = secret_formula(start_point)
# print("With a starting point of:%d" % start_point)
# print("We'd have %d beans, %d jars,and %d crates" %(beans,jars,crates))
#
# start_point =start_point/10
# print("We can also do that this way:")
# print("We'd have %d beans,%d jars,and %d crates" %secret_formula(start_point))
